﻿#ifndef TCPASSISTANT_H
#define TCPASSISTANT_H

#include <QMainWindow>
#include <QThread>
#include <QTcpSocket>
#include <QUdpSocket>
#include "myserver.h"
#include <QButtonGroup>
#include "net_def.h"

namespace Ui {
class TcpAssistant;
}


class TcpAssistant : public QMainWindow
{
    Q_OBJECT

public:
    explicit TcpAssistant(QWidget *parent = nullptr);
    ~TcpAssistant();

    Ui::TcpAssistant *ui;

    SocketHelper* sockethelper;                     //socket创建辅助对象

    QList<MyThread*> list_thread;                   //线程列表

    QList<SocketInformation> list_information;      //socket信息列表

    MainWindow* mainwindow;

private slots:
    void on_btn_clientConnect_clicked();

    void on_btn_clientClearRec_clicked();

    void on_btn_clientClearSend_clicked();

    void on_btn_clientSend_clicked();

private:

    MyServer* m_tcpServer;

    QTcpSocket* m_tcpSocket;

public slots:

    void ClinetReadData();

    void ClientReadError(QAbstractSocket::SocketError);
};

#endif // TCPASSISTANT_H
